import request from '@/config/axios'

export interface StoreEmployeeVO {
  id: number
  code: string
  agentCode: string
  storeCode: string
  systemUserCode: string
  nickname: string
  level: string
  hasReference: boolean
  referenceSystemUserCode: string
  hasShow: boolean
}
export interface StoreEmployeeProjectVO {
  id: number
  originalPrice: number
}
// 查询门店员工关系分页
export const getStoreEmployeePage = async (params) => {
  return await request.get({ url: `/meijia/store-employee/page`, params })
}

// 查询门店员工关系详情
export const getStoreEmployee = async (id: number) => {
  return await request.get({ url: `/meijia/store-employee/get?id=` + id })
}

// 新增门店员工关系
export const createStoreEmployee = async (data: StoreEmployeeVO) => {
  return await request.post({ url: `/meijia/store-employee/create`, data })
}

// 修改门店员工关系
export const updateStoreEmployee = async (data: StoreEmployeeVO) => {
  return await request.put({ url: `/meijia/store-employee/update`, data })
}

// 删除门店员工关系
export const deleteStoreEmployee = async (id: number) => {
  return await request.delete({ url: `/meijia/store-employee/delete?id=` + id })
}

// 导出门店员工关系 Excel
export const exportStoreEmployee = async (params) => {
  return await request.download({ url: `/meijia/store-employee/export-excel`, params })
}
// 获得门店可绑定的普通员工（美发师、门店老板）
export const getBindableOrdinaryEmployeeList = async (params) => {
  return await request.get({ url: `/meijia/store-employee/get-bindable-ordinary-employee-list`, params })
}

// 获得门店调整价格数据
export const getEditProject = async (storeCode: string) => {
  return await request.get({ url: `/meijia/store-employee-project/get-edit-project?storeCode=` + storeCode })
}
// 更新门店员工项目价格
export const updateStoreEmployeeProjectPrice = async (data: StoreEmployeeProjectVO) => {
  return await request.put({ url: `/meijia/store-employee-project/update-price`, data })
}